package com.simulation;

import java.util.ArrayList;
import java.util.List;

import sim.engine.SimState;

import com.database.bean.Agent;
import com.database.bean.CompanyProduct;
import com.database.bean.Game;
import com.database.bean.Round;
import com.logic.service.AdminService;

public class AgentsSimulation extends SimState {

	private static final long serialVersionUID = 1L;
	private Game game=null;
	private List<Agent> agents=new ArrayList<Agent>();
	private Round simulationRound=null;
	private AdminService adminService=null;
	private List<CompanyProduct> allOfferedProducts=null;
	private Double minimumSellingPrice=null;
	private Double maximumSellingPrice=null;
	private Double minimumCompanyImage=null;
	private Double minimumProductQuality=null;
	private Double maximumCompanyImage=null;
	private Double maximumProductQuality=null;

	public AgentsSimulation(long seed) {
		super(seed); // use the constructor for SimState
	}
	
	public void start() {
		super.start(); // reuse the SimState start method
		if(agents!=null){
			for (Agent ag : agents) {
					schedule.scheduleOnce(ag);
			}
		}
		else{
			throw new RuntimeException("No Game setted to simulate!");
		}
	}


	public Game getGame() {
		return game;
	}


	public void setGame(Game game) {
		this.game = game;
	}

	public List<Agent> getAgents() {
		return this.agents;
	}

	public void setAgents(List<Agent> agents) {
		this.agents = agents;
	}
	
	public void addAgent(Agent agent){
		this.agents.add(agent);
	}

	public void addAgents(List<Agent> agents){
		this.agents.addAll(agents);
	}

	public Round getSimulationRound() {
		return simulationRound;
	}

	public void setSimulationRound(Round simulationRound) {
		this.simulationRound = simulationRound;
	}

	public AdminService getAdminService() {
		return adminService;
	}

	public void setAdminService(AdminService adminService) {
		this.adminService = adminService;
	}

	public List<CompanyProduct> getAllOfferedProducts() {
		return allOfferedProducts;
	}

	public void setAllOfferedProducts(List<CompanyProduct> allOfferedProducts) {
		this.allOfferedProducts = allOfferedProducts;
	}

	public Double getMinimumSellingPrice() {
		return minimumSellingPrice;
	}

	public void setMinimumSellingPrice(Double minimumSellingPrice) {
		this.minimumSellingPrice = minimumSellingPrice;
	}

	public Double getMinimumCompanyImage() {
		return minimumCompanyImage;
	}

	public void setMinimumCompanyImage(Double minimumCompanyImage) {
		this.minimumCompanyImage = minimumCompanyImage;
	}

	public Double getMinimumProductQuality() {
		return minimumProductQuality;
	}

	public void setMinimumProductQuality(Double minimumProductQuality) {
		this.minimumProductQuality = minimumProductQuality;
	}

	public Double getMaximumCompanyImage() {
		return maximumCompanyImage;
	}

	public void setMaximumCompanyImage(Double maximumCompanyImage) {
		this.maximumCompanyImage = maximumCompanyImage;
	}

	public Double getMaximumProductQuality() {
		return maximumProductQuality;
	}

	public void setMaximumProductQuality(Double maximumProductQuality) {
		this.maximumProductQuality = maximumProductQuality;
	}

	public Double getMaximumSellingPrice() {
		return maximumSellingPrice;
	}

	public void setMaximumSellingPrice(Double maximumSellingPrice) {
		this.maximumSellingPrice = maximumSellingPrice;
	}
	
	

} // end AgentsSimulation class
